package com.gitee.linzl.basic;
//package com.nick.basic;
//
//import org.apache.kafka.clients.producer.ProducerConfig;
//import org.apache.kafka.common.serialization.StringSerializer;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.kafka.core.DefaultKafkaProducerFactory;
//import org.springframework.kafka.core.KafkaTemplate;
//import org.springframework.kafka.support.serializer.JsonSerializer;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * Created by dreamcatchernick on 19/09/2017.
// */
//@Configuration
//public class BasicProducerConfig {
//	@Value("${kafka.bootstrap-servers}")
//	private String bootstrapServers;
//
//	@Bean
//	public KafkaTemplate<String, Basic> basicKafkaTemplate() {
//		Map<String, Object> configProps = new HashMap<>();
//		configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
//		configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
//		configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
//
//		return new KafkaTemplate<>(new DefaultKafkaProducerFactory<>(configProps));
//	}
//}
